QuickOPC User's Guide and Reference
CreateArray(DataType,Int64[],Func<Int64,GenericData>) Method



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.DataTypeModel Namespace > SequenceData Class > CreateArray Method : CreateArray(DataType,Int64[],Func<Int64,GenericData>) Method
The data type of the elements of the array.
An array of integers that represent the size of each dimension the array to create.
A function that creates a new element of the array.
Creates a sequence data that represents a one-dimensional array.
Syntax
'Declaration
 
<NotNullAttribute()>
Public Overloads Shared Function CreateArray( _
   ByVal elementDataType As DataType, _
   ByVal lengths() As Long, _
   ByVal createElementFunction As Func(Of Long,GenericData) _
) As SequenceData
'Usage
 
Dim elementDataType As DataType
Dim lengths() As Long
Dim createElementFunction As Func(Of Long,GenericData)
Dim value As SequenceData
 
value = SequenceData.CreateArray(elementDataType, lengths, createElementFunction)

Parameters

elementDataType
The data type of the elements of the array.
lengths
An array of integers that represent the size of each dimension the array to create.
createElementFunction
A function that creates a new element of the array.

Return Value

A new sequence data that represent one-dimensional array of the specified elementDataType with the specified length.
Exceptions
ExceptionDescription

One of the arguments provided to a method is not valid.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also